//引入axios
import axios from 'axios'
//引入vuex,便于存放公共地址，防止代码冗余
import store from '../store/index'
const ips = {
  development: 'http://127.0.0.1:7001'
}
const Axios = axios.create({
  baseURL: ips[process.env.NODE_ENV],
  method: 'GET',
})

Axios.interceptors.request.use(
  (config) => {
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)

Axios.interceptors.response.use(
  (config) => {
    let { data } = config
    return data
  },
  (error) => {
    return Promise.reject(error)
  }
)
export default Axios






